<%@page import="itpenguin.review.entities.Item"
%><%@page import="java.util.Date"
%><%@page import="java.util.List"
%><%@page import="itpenguin.common.PMFactory"
%><%@page import="javax.jdo.PersistenceManager"
%><%@page import="javax.jdo.Query"
%><%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" 
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" 
%><?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<fmt:setLocale value="ja-JP" />
<%
	PersistenceManager pm = PMFactory.getInstance().getPersistenceManager();
	Query query = pm.newQuery("select from itpenguin.review.entities.Item order by reviewDate desc");  
	List<Item> itemList = (List<Item>) query.execute();
	pageContext.setAttribute("itemList", itemList);
	pageContext.setAttribute("prefix", "http://review.it-penguin.com");
	pageContext.setAttribute("now", new Date());
%>
	<c:forEach items="${itemList}" var="item" varStatus="status">
		<c:if test="${status.count == 1}">
		   <url>
		      <loc>${prefix}/</loc>
		      <lastmod><fmt:formatDate value="${item.lastModified}" pattern="yyyy-MM-dd" timeZone="UTC" />T<fmt:formatDate value="${item.lastModified}" pattern="HH:mm:ss" timeZone="UTC" />+00:00</lastmod>
		      <changefreq>weekly</changefreq>
		      <priority>0.7</priority>
		   </url>
		</c:if>
	   <url>
	      <loc>${prefix}/review/${item.itemId}</loc>
 	      <lastmod><fmt:formatDate value="${item.lastModified}" pattern="yyyy-MM-dd" timeZone="UTC" />T<fmt:formatDate value="${item.lastModified}" pattern="HH:mm:ss" timeZone="UTC" />+00:00</lastmod>
	      <changefreq>never</changefreq>
	      <priority>0.5</priority>
	   </url>
	</c:forEach>
</urlset>